class Config:
    #密钥
    SECRET_KEY = '123456'
    # 数据库
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    #缓存
    CACHE_TYPE = "redis"
    CACHE_REDIS_HOST = "127.0.0.1"
    CACHE_REDIS_PORT = "6379"
    CACHE_REDIS_DB = 1

#开发环境配置
class DevelopConfig(Config):
    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://users:123456@10.8.158.14:3306/book_share"
    # SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:123456@localhost:3306/book_share"

#测试环境配置
class TestingConfig(Config):
    SQLALCHEMY_DATABASE_URI = "TESTING"


#生产环境配置
class ProductConfig(Config):
    SQLALCHEMY_DATABASE_URI = "PRODUCT"


config = {
    'develop': DevelopConfig,
    'test': TestingConfig,
    'product': ProductConfig,
    'default': DevelopConfig
}